package com.ss.android.common.app;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;

public class AbsFragment extends Fragment{
	protected boolean mStatusActive;
	protected boolean mStatusDestroyed;
	protected boolean mStatusViewValid;
	
	public boolean isActive(){
		return this.mStatusActive;
	}
	
	public boolean isDestoryed(){
		return this.mStatusDestroyed;
	}
	
	public boolean isViewValid(){
		return this.mStatusViewValid;
	}
	
	public void onCreate(Bundle bundle){
		super.onCreate(bundle);
		this.mStatusActive=false;
		this.mStatusViewValid=false;
		this.mStatusDestroyed=false;
	}
	
	public void onDestory(){
		super.onDestroy();
		this.mStatusViewValid=false;
		this.mStatusDestroyed=true;
	}
	
	public void onDestoryView(){
		super.onDestroyView();
		this.mStatusViewValid=false;
	}
	
	public void onResume(){
		super.onResume();
		this.mStatusActive=true;
	}
	
	public void onStop(){
		super.onStop();
		this.mStatusActive=false;
	}
	
	public void onViewCreated(View view,Bundle savedInstanceState){
		super.onViewCreated(view, savedInstanceState);
		this.mStatusViewValid=true;
	}
}
